package com.atguigu.ggkt.vod.utils;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
/*
常量类，读取配置文件application.properties中的配置
 */
//把普通pojo实例化到spring容器中
@Component
public class ConstantPropertiesUtil implements InitializingBean {
    @Value("${tencent.cos.SecretId}")
    private String secretId;
    @Value("${tencent.cos.SecretKey}")
    private String secretKey;
    @Value("${tencent.cos.BucketName}")
    private String bucketName;
    @Value("${tencent.cos.RegionName}")
    private String regionName;

    public static String END_POINT;
    public static String ACCESS_KEY_ID;
    public static String ACCESS_KEY_SECRET;
    public static String BUCKET_NAME;
    @Override
    public void afterPropertiesSet() throws Exception {
        END_POINT = regionName;
        ACCESS_KEY_ID = secretId;
        ACCESS_KEY_SECRET = secretKey;
        BUCKET_NAME = bucketName;
    }
}
